//Display conversation messages and the person saying it
function message()
{

	this.timer =3 ;
	this.play = new Image();
	this.play.src = "Images/npc.png";
	this.list = new Image();
	this.list.src = "Images/list.png";
	this.box = new Image();
	this.box.src = "Images/box.png";

	this.display_img = function(id)
	{
		if(id==1)
		{
			txt.drawImage(this.play, 6, 3,25,25);
		}

	}

	this.display_msg = function(id, msg)
	{
		temp_msg = msg.substr(0,(this.timer/3));

		txt.fillStyle    = '#D8D8D8';
		txt.font         = '20px Courier New';
		txt.fillText  ("Spy : "+temp_msg, 40, 20);

		this.timer++;

	}

	this.displaytext = function(id,msg)
	{
		this.display_img(id);
		this.display_msg(id,msg);
	}

	this.display_list = function()
	{	
		alert("a");
		dlg.drawImage(this.list, 600,50);
		dlg.save();
		dlg.globalAlpha = 0.4;
		if( mouse_x>110 && mouse_x<(this.box.width+110) )
			if( mouse_y>82 && mouse_y<150 )
				dlg.globalAlpha = 0.6;

		dlg.drawImage(this.box, 615,65,this.list.width - 30, this.list.height/7);
		dlg.restore();

		dlg.fillStyle    = '#000000';
		dlg.font         = '20px Courier New';
		dlg.fillText  ("Who are you ?", 630, 100);	
	}

}
